﻿using System;
using System.Data;
using Team4Mock.DAO;

namespace Team4Mock.Entity
{
    public class GovernmentEntity
    {
        GovernmentDAO gd=new GovernmentDAO();
        private int govOfficeRegionID;
        private int countyId;
        private string govOfficeRegionName;
        private string isActive;
        public GovernmentEntity()
        { }
        public GovernmentEntity(int countyId, string govOfficeRegionName, string isActive)
        {
            this.countyId = countyId;
            this.govOfficeRegionName = govOfficeRegionName;
            this.isActive = isActive;
        }
        public int GovOfficeRegionID
        {
            get { return govOfficeRegionID; }
            set { govOfficeRegionID = value; }

        }
        public int CountyId
        {
            get { return this.countyId; }
            set
            {
                if (value == 0)
                    throw new Exception("countyId not allow nullvalue.");
                this.countyId = value;
            }
        }
        public string GovOfficeRegionName
        {
            get { return this.govOfficeRegionName; }
            set
            {
                if (value == null)
                    throw new Exception("govOfficeRegionName not allow nullvalue.");
                this.govOfficeRegionName = value;
            }
        }
        public string IsActive
        {
            get { return this.isActive; }
            set { this.isActive = value; }
        }
        public DataTable Getdata()
        {
            return gd.Getdata();
        }
        public DataTable GetdataByID(GovernmentEntity e)
        {
            return gd.GetdataByID(e.GovOfficeRegionID);
        }
    }
}